package cn.micro.tree.bean;

import java.util.Map;

/**
 * 节点属性
 */
public class TreeNode {

    public TreeNode(String nid, String name, String pid) {
        this.nid = nid;
        this.name = name;
        this.pid = pid;
    }

    public TreeNode(String nid, String name, String pid, Integer sort, Map<String, Object> args) {
        this.nid = nid;
        this.name = name;
        this.pid = pid;
        this.sort = sort;
        this.args = args;
    }

    public TreeNode(Integer nid, String name, Integer pid) {
        this.nid = String.valueOf(nid);
        this.name = name;
        this.pid = String.valueOf(pid);
    }

    public TreeNode(Long nid, String name, Long pid) {
        this.nid = String.valueOf(nid);
        this.name = name;
        this.pid = String.valueOf(pid);
    }

    public TreeNode(String nid, String name, String pid, Integer sort) {
        this.nid = nid;
        this.name = name;
        this.pid = pid;
        this.sort = sort;
    }

    public TreeNode(Integer nid, String name, Integer pid, Integer sort) {
        this.nid = String.valueOf(nid);
        this.name = name;
        this.pid = String.valueOf(pid);
        this.sort = sort;
    }

    public TreeNode(Long nid, String name, Long pid, Integer sort) {
        this.nid = String.valueOf(nid);
        this.name = name;
        this.pid = String.valueOf(pid);
        this.sort = sort;
    }

    /**
     * 节点主键 Id
     */
    private String nid;

    /**
     * 节点名称
     */
    private String name;

    /**
     * 父级节点主键 Id
     */
    private String pid;

    /**
     * 节点排序号
     */
    private Integer sort = 0;

    /**
     * 节点挂载属性
     */
    private Map<String, Object> args;

    public String getNid() {
        return nid;
    }

    public void setNid(String nid) {
        this.nid = nid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Map<String, Object> getArgs() {
        return args;
    }

    public void setArgs(Map<String, Object> args) {
        this.args = args;
    }

}
